#!/bin/bash

set -e
set -x

# wget https://github.com/prometheus/prometheus/releases/download/v2.53.3/prometheus-2.53.3.linux-amd64.tar.gz
bypy download prometheus-2.53.3.linux-amd64.tar.gz
tar xf prometheus-2.53.3.linux-amd64.tar.gz
mv prometheus-2.53.3.linux-amd64 /opt/prometheus
useradd -M -s /usr/sbin/nologin prometheus
chown prometheus:prometheus -R /opt/prometheus/
cp prometheus.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable prometheus --now
sh ../check_port.sh 9090

set +x
set +e